#ifndef G3_DDS
#define G3_DDS

#ifndef __glee_h_
#include "GLee/GLee.h"
#endif

#include "types.h"
#include "log.h"

#include "file/f_stream.h"
#include "tex_bitmap.h"

#ifndef MAKEFOURCC
#define MAKEFOURCC(ch0, ch1, ch2, ch3) ((dword)(byte)(ch0) | ((dword)(byte)(ch1) << 8) | ((dword)(byte)(ch2) << 16) | ((dword)(byte)(ch3) << 24))
#endif

#define FOURCC_DXT1 MAKEFOURCC('D', 'X', 'T', '1')
#define FOURCC_DXT3 MAKEFOURCC('D', 'X', 'T', '3')
#define FOURCC_DXT5 MAKEFOURCC('D', 'X', 'T', '5')

#define G3_DDS_PIXEL_DATA_OFFSET 128
#define G3_DDS_FOURCC_OFFSET 84
#define G3_DDS_MIPMAP_COUNT_OFFSET 28
#define G3_DDS_LINEAR_SIZE_OFFSET 20
#define G3_DDS_WIDTH_OFFSET 16
#define G3_DDS_HEIGHT_OFFSET 12

namespace G3 {

boost::shared_ptr<G3::BITMAP> LoadDDS (STREAM *Stream, LOG *Log);

}

#endif
